package com.pitop.sync.entity;

/**
 * SyncNewData中的event状态 Insert添加,Update修改,Delete删除
 */
public enum EventState {
    Insert("添加"),
    Update("修改"),
    Delete("删除"),;
    public String val;

    EventState(String val) {
        this.val = val;
    }

    /**
     * 根据状态名称查询状态
     *
     * @param stateName
     * @return
     */
    public static EventState getEnum(String stateName) {
        for (EventState eventState : EventState.values()) {
            if (eventState.name().equalsIgnoreCase(stateName)) {
                return eventState;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return this.name();
    }
}
